<template>
  <!-- 会员信息详情页面 -  基本信息组件 -->
  <div class="info">
    <div class="left">
      <el-image 
        style="width: 100%;"
        :src="info.icon" 
        :preview-src-list="[info.icon]">
      </el-image>
    </div>
    <div class="right">
      <el-form label-width="150px" align="left">
        <el-form-item label="姓名：">
          {{ info.realName || '' }}
        </el-form-item>
        <el-form-item label="微信名称：">
          {{ info.wxName || '' }}
        </el-form-item>
        <el-form-item label="性别：">
          {{ info.gender == 0 ? '男' : '女' }}
        </el-form-item>
        <el-form-item label="手机号：">
          {{ info.phone || '' }}
        </el-form-item>
        <el-form-item label="生日：">
          {{ G_time(info.birthDay, 0) || '' }}
        </el-form-item>
        <el-form-item label="地址：">
          {{ info.country + info.province + info.city }}
        </el-form-item>
        <el-form-item label="详细地址：">
          {{ info.address || '' }}
        </el-form-item>
        <el-form-item label="是否关注公众号：">
          {{ info.attention == 0 ? '未关注' : '已关注' }}
        </el-form-item>
        <el-form-item label="微信openId：">
          {{ info.openId || '' }}
        </el-form-item>
        <el-form-item label="微信号：">
          {{ info.wechatNumber || '' }}
        </el-form-item>
        <el-form-item label="紧急联系人：">
          {{ info.emergencyContact || '' }}
        </el-form-item>
        <el-form-item label="紧急联系电话：">
          {{ info.emergencyPhone || '' }}
        </el-form-item>
        <el-form-item label="会员有效期：">
          {{ G_time(info.userValidUntil, 0) || '' }}
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
  import { vipUserDetail } from '@/utils/apiMember.js'
  export default {
    data() {
      return {
        info: ''
      }
    },
    mounted () {
      vipUserDetail({vipUserId: this.$route.query.id}).then(res => {
        if (res.errCode == 200) {
          this.info = res.data.vipUser
        }
      })
    },
  }
</script>

<style lang="scss" scoped>
.info {
  display: flex;
  .left,.right {
    flex: 1;
  }
}
</style>